<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title th:text="${session.title}">123</title>
    <link th:replace="common/header"/>
    <link rel="stylesheet" th:href="@{/css/ace-skins.min.css}"/>
    <link th:replace="common/tip"/>
</head>
<body class="navbar-fixed">
<div th:replace="common/top"></div>
<div class="container-fluid main_bg" id="main-container">
    <a id="menu-toggler" href="#"><span></span></a>
    <div th:replace="common/menu"></div>
    <div id="main-content" class="clearfix">
        <div id="page-content" class="clearfix">
            <div th:replace="common/title"></div>
            <h3 class="header smaller lighter blue"><em class="icon-eye-open"></em>查看球队</h3>
            <div th:if="${session.footUser.qx.text == '管理员'}">
                <div class="row-fluid">
                    <div class="span5">
                        <img src="" alt="" th:src="@{'/' + ${footQd.qcUrl}}" th:if="${footQd.qcUrl != null}">
                        <img src="" alt="" th:src="@{'/images/logo2.png'}" th:if="${footQd.qcUrl == null}">
                    </div>
                    <div class="span7">
                        <div class="row-fluid">
                            <div class="span2">
                                <div class="control-group">
                                    <div class="controls">
                                        队标:
                                        <img th:src="@{'/' + ${footQd.logoUrl}}" alt="" src=""
                                             th:if="${footQd.logoUrl != null}"/>
                                        <img th:src="@{/images/unknow_team.png}" alt="" src="" style="max-height: 100px"
                                             th:if="${footQd.logoUrl == null}"/>
                                        <img th:src="@{'/' + ${footQd.sltUrl}}" alt="" src=""
                                             th:if="${footQd.sltUrl != null}"/>
                                        <img th:src="@{/images/unknow_team.png}" alt="" src="" style="max-height: 100px"
                                             th:if="${footQd.sltUrl == null}"/>
                                    </div>
                                </div>
                            </div>
                            <div class="span10">
                                <div class="row-fluid">
                                    <div class="span4">
                                        <div class="control-group">
                                            <div class="controls" th:text="'球队名称:' + ${footQd.qdmc}">
                                                123
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span4">
                                        <div class="control-group">
                                            <div class="controls" th:text="'球队编码:' + ${footQd.qdbm}">
                                                123
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span4">
                                        <div class="control-group">
                                            <div class="controls" th:text="'所属联赛:' + ${footQd.sslsName}">
                                                123
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <div class="span4">
                                        <div class="control-group">
                                            <div class="controls">
                                                球队简介:<textarea rows="20" class="input_fix2" name="qdjj" id="qdjj"
                                                               th:field="${footQd.qdjj}" title=""></textarea>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span4">
                                        <div class="control-group">
                                            <div class="controls">
                                                重要奖项:<textarea rows="20" class="input_fix2" name="zyjx" id="zyjx"
                                                               th:field="${footQd.zyjx}" title=""></textarea>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span4">
                                        <div class="control-group">
                                            <div class="controls"
                                                 th:text="'城市:' + ${footQd.cs == null ? '' : footQd.cs}">
                                                123
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <div class="span4">
                                        <div class="control-group">
                                            <div class="controls"
                                                 th:text="'成立时间:' + ${footQd.clsj == null ? '' : #dates.format(footQd.clsj, 'yyyy-MM-dd')}">
                                                123
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span4">
                                        <div class="control-group">
                                            <div class="controls"
                                                 th:text="'主场:' + ${footQd.address == null ? '' : footQd.address}">
                                                123
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <form class="form-horizontal" th:object="${footQdSearchForm}" method="post"
                          th:action="@{/foot/footQd/search}" name="form">
                        <input type="hidden" name="pageIndex" th:field="*{pageIndex}"/>
                        <input type="hidden" name="pageSize" th:field="*{pageSize}"/>
                        <div class="text-center span12">
                            <a class="btn btn-primary" type="button" onclick="updateQd()"><em class="icon-edit"></em>更新</a>
                            <a class="btn btn-primary" type="button" th:href="@{/foot/footQd/edit(id=${footQd.id})}"><em
                                    class="icon-edit"></em>修改</a>
                            <a class="btn btn-danger" type="button"
                               th:onclick="'javascript:deleteById(\'/foot/footQd/delete?id=\', ' + ${footQd.id} + ')'"><em
                                    class="icon-remove"></em>删除</a>
                            <a class="btn" type="button" th:href="@{/foot/footQd/search}"><em
                                    class="icon-arrow-left"></em>返回</a>
                        </div>
                    </form>
                </div>
            </div>
            <!--/#page-content-->
        </div>
        <div th:replace="common/skin :: skin"></div>
    </div>
    <!--/#main-content-->
</div>
<!--/.fluid-container#main-container-->
<div th:replace="common/jsList"></div>
<script th:inline="javascript">
    function updateQd() {
        var qdjj = $("#qdjj").val();
        var zyjx = $("#zyjx").val();
        $.ajax({
            type: "POST",
            dataType: "json",
            url: "/foot/footQd/update",
            data: "id=" + [[${footQd.id}]] + "&qdjj=" + qdjj + "&zyjx=" + zyjx,
            success: function (data) {
                if (data.msg === 'ok') {
                    window.location.reload();
                } else {
                    showTip('tip', '无法更改球队信息', 4000);
                }
            }
        });
    }
</script>
</body>
</html>